package com.hsgc.threadlocal;

import com.hsgc.info.PageInfo;

public class LocalPageInfoUtil {

    private static ThreadLocal<PageInfo> localPageInfoThreadLocal = new ThreadLocal<>();

    //线程上设置一个标签{k,v}
    public static void set(PageInfo pageInfo){
        localPageInfoThreadLocal.set(pageInfo);
    }
//从线程上获取标签 但是并没有删除的业务
    public static PageInfo get(){
       return localPageInfoThreadLocal.get();
    }
    // 设定删除的操作
    public static void remove(){
        localPageInfoThreadLocal.remove();
    }
}
